<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta name="Content-Type" content="text/html; charset=UTF-8" />
<title>Module: MasterMayI::ControllerExtensions::ClassMethods</title>
<link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
<link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />

<script type="text/javascript" charset="utf-8">
  relpath = '../..';
  if (relpath != '') relpath += '/';
</script>
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>

  </head>
  <body>
    <div id="header">
      <div id="menu">
  
    <a href="../../_index.html">Index (C)</a> &raquo; 
    <a href="../../MasterMayI.html" title="MasterMayI">MasterMayI</a> &raquo; <a href="../ControllerExtensions.html" title="ControllerExtensions">ControllerExtensions</a>
     &raquo; 
    <span class="title">ClassMethods</span>
  
</div>

      <div id="search">
  <a id="class_list_link" href="#">Namespace List</a>
  <a id="method_list_link" href="#">Method List</a>
  <a id ="file_list_link" href="#">File List</a>
</div>

      <div class="clear"></div>
    </div>
    
    <iframe id="search_frame"></iframe>
    
    <div id="content"><h1>Module: MasterMayI::ControllerExtensions::ClassMethods 
  
  
</h1>

<dl class="box">
  
  
    
  
    
      <dt class="r1">Includes:</dt>
      <dd class="r1"><a href="Filters.html" title="MasterMayI::ControllerExtensions::Filters">MasterMayI::ControllerExtensions::Filters</a></dd>
      
    
  
  
    <dt class="r2 last">Defined in:</dt>
    <dd class="r2 last">lib/master_may_i/controller_extensions.rb</dd>
  
</dl>
<div class="clear"></div>



  
  
  
  

  <h2>Method Summary</h2>
  <ul class="summary">
    
      <li class="public ">
  <span class="summary_signature"><a href="#protects_restful_actions-instance_method" title="#protects_restful_actions (instance method)">- (Object) <strong>protects_restful_actions</strong> </a>
  
  </span>
  
  
  
  

  
    <span class="summary_desc">
Modifies your InheritedResources controller to protect access to the
resource.

</span>
  
</li>

    
  </ul>


  
  
  
  
  
  <h3 class="inherited">Methods included from <a href="Filters.html" title="MasterMayI::ControllerExtensions::Filters">MasterMayI::ControllerExtensions::Filters</a></h3>
  <p class="inherited"><a href="Filters.html#collection-instance_method" title="#collection">#collection</a>, <a href="Filters.html#ensure_can_create_record-instance_method" title="#ensure_can_create_record">#ensure_can_create_record</a>, <a href="Filters.html#ensure_can_destroy_record-instance_method" title="#ensure_can_destroy_record">#ensure_can_destroy_record</a>, <a href="Filters.html#ensure_can_edit_record-instance_method" title="#ensure_can_edit_record">#ensure_can_edit_record</a>, <a href="Filters.html#ensure_can_show_record-instance_method" title="#ensure_can_show_record">#ensure_can_show_record</a>, <a href="Filters.html#included-class_method" title="included">included</a></p>


  <div id="method_details">
    <h2>Method Details</h2>
    
      <div class="method_details first">
  <p class="signature first" id="protects_restful_actions-instance_method">
  
    - (<tt>Object</tt>) <strong>protects_restful_actions</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
Modifies your InheritedResources controller to protect access to the
resource.
</p>
<p>
protects_restful_actions redefines the collection method to filter by
Model.listable. This ensures that only listable records show up on the
index page.
</p>
<p>
protects_restful_actions also adds before filters to your
InheritedResources controller that protect access to the resource.
</p>
<p>
The before filters make use of the
<tt><a href="../ControllerExtensions.html#deny_access-instance_method" title="deny_acces">deny_acces</a></tt> helper to set the
flash, save the intended location, and redirect the user.
</p>


  </div>
</div>
<div class="tags">
  
  <h3>See Also:</h3>
  <ul class="see">
    
      <li><a href="Filters.html#ensure_can_create_record-instance_method" title="ensure_can_create_record">ensure_can_create_record</a></li>
    
      <li><a href="Filters.html#ensure_can_show_record-instance_method" title="ensure_can_show_record">ensure_can_show_record</a></li>
    
      <li><a href="Filters.html#ensure_can_edit_record-instance_method" title="ensure_can_edit_record">ensure_can_edit_record</a></li>
    
      <li><a href="Filters.html#ensure_can_destroy_record-instance_method" title="ensure_can_destroy_record">ensure_can_destroy_record</a></li>
    
  </ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


134
135
136</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/master_may_i/controller_extensions.rb', line 134</span>

<span class='def def kw'>def</span> <span class='protects_restful_actions identifier id'>protects_restful_actions</span>
  <span class='include identifier id'>include</span> <span class='MasterMayI constant id'>MasterMayI</span><span class='colon2 op'>::</span><span class='ControllerExtensions constant id'>ControllerExtensions</span><span class='colon2 op'>::</span><span class='Filters constant id'>Filters</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

</div>
    
    <div id="footer">
  Generated on Wed Dec 23 03:17:30 2009 by 
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
  0.4.0 (ruby-1.8.6).
</div>

  </body>
</html>